﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button2_MouseMove(object sender, MouseEventArgs e)
        {
            button2.Top = button2.Top - e.Y;
            button2.Left = button2.Left+ e.Y;
            if (button2.Top < -20 || button2.Top > 100)
                button2.Top = 100;
            if (button2.Left < -80 || button2.Left > 250)
                button2.Left = 200;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            MessageBox.Show("Мы нисколько не сомневались,что вы так думаете!");
        }

        private void button2_Click(object sender, EventArgs e)
        {

        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }
    }
}
